package com.zhanglijie.theory.workthread;

/**
 * @author zhanglijie
 * @version 1.0
 * @since 1.1.0 2022/8/14 0014 20:25
 */
public class Contract {
    private int no;
    private String name;

    public Contract(int no, String name) {
        this.no = no;
        this.name = name;
    }

    @Override
    public String toString() {
        return "Contract{" + "no=" + no + ", name='" + name + '\'' + '}';
    }

    public void execute()   {
        try {
            System.out.println(Thread.currentThread()
                .getName() + "==执行了" + this);
            Thread.sleep(1000);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
